package com.cplsys.iacna.hibernate.utils;

import java.io.File;

import org.hibernate.HibernateException;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.*;

import com.cplsys.iacna.domain.*;

public class HibernateUtil {
	private static final SessionFactory sessionFactory;
    static {
        try {
            sessionFactory = new AnnotationConfiguration()
                    .configure(new File("c:/hibernate.cfg.xml"))
                    .buildSessionFactory();
        } catch (Exception ex) {
            throw new ExceptionInInitializerError(ex);
        }
    }

    public static SessionFactory getSessionFactory()
            throws HibernateException {
        return sessionFactory;
    } 

 }